<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
  <title>111</title>
  <link rel="stylesheet" href="./example/example.css">
  <!-- <link rel="stylesheet" href="http://ecstest.ledc.changyan.cn/common-static/js/common/common.navbar.css"> -->
</head>
<body>
  <div id="content_main"></div>
  <button id="uploader-button" class="example-button">点击上传</button>
  <div class="example-list">
    <div id="filelist"></div>
  </div>
  <script src="dist/uploader.js"></script>
  <script>
  var UPLOADER_PATH = 'http://localhost:4001/preupload'
  var uploader = new window.Uploader({
    path: UPLOADER_PATH,
    headers: {},
    // uploadPath: 'http://10.4.86.4:4000/upload/fileUpload',
    uploadPath: 'http://10.4.87.35:8080/api-fileupload-svc/?method=upload.fileUpload&version=1.0',
    btnEl: document.getElementById('uploader-button'),
    fileListEl: document.getElementById('filelist'),
    env: 'webui', // webui > mobileui > websdk > mobilesdk
    theme: 'default',
    accepts: 'images/*', // 可选，接收格式，如果
    whiteSuffixList: ['png', 'gif', 'jpeg', 'mp4', 'zip'], // 可上传图片的格式
    // auto: false,
    customUI: false,
    md5: true,
    type: 'ws', // 'ws'>'http'>'flash'. default: 'ws'
    queued: '2'
  })
  // 选择文件
  uploader.on('change', function (files) {
    console.log('change')
  })
  // 文件正在上传中
  uploader.on('progress', function (files) {
    // console.log('progress...', files)
  })
  // 文件上传完成
  uploader.on('success', function (file) {
    console.log('success')
  })
  // 所有的文件都上传完成
  uploader.on('alluploaded', function () {
    console.log('allupload')
  })
  // 文件上传失败
  uploader.on('fail', function (file) {
    console.log('fail')
  })
  uploader.on('error', function (file, msg) {
    console.log('error', msg)
  })
  console.log(uploader)
  </script>
  <!-- <script src="http://ecstest.ledc.changyan.cn/common-static/js/jquery-1.8.3.min.js"></script>
  <script>
  $.getScript('http://ecstest.ledc.changyan.cn/common-static/js/common/common.navbar.js', function () {
    console.log(222)
  })
  </script> -->
</body>
</html>